---
title: "Deleting Files"
sidebar_label: "Delete"
sidebar_position: 4
description: "Delete files stored in Convex"
---

import DeleteImage from "!!raw-loader!@site/../private-demos/snippets/convex/deletingFiles.ts";

Files stored in Convex can be deleted from
[mutations](/functions/mutation-functions.mdx),
[actions](/functions/actions.mdx), and
[HTTP actions](/functions/http-actions.mdx) via the
[`storage.delete()`](/api/interfaces/server.StorageWriter#delete) function,
which accepts a storage ID.

Storage IDs correspond to documents in the `"_storage"` system table (see
[Metadata](/file-storage/file-metadata.mdx)), so they can be validated using the
`v.id("_storage")`.

<TSAndJSSnippet
  title="convex/images.ts"
  sourceTS={DeleteImage}
  sourceJS={DeleteImage}
  highlightPatterns={["delete\\("]}
/>
